/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package practicasscjp;

/**
 *
 * @author Luis_Angel
 */
public class TestRaro1 {

    static int f1(int i) {
        System.out.print(i + ",");
        return 0;
    }

    public static void main(String[] args) {
        int i = 0;
        int j = 0;
        // i is incremented from 0 to 1 in the below statement. But since pre-fix, 0 is the value assigned to j
        j = i++;
        // The call of f1(j) prints 0 in the f1() method
        j = j + f1(j);

        // The call of f1(i) prints 2 in the f1() method. But the f1(int i) method returns 0 to the caller.
        // Hence the expression i = 1 (increment i) + f1(2) becomes i = 1 + 0;
        i = i++ + f1(i) + i++ ;
        System.out.println(i);
    }
}
